<include file="Public:header" />
<include file="Public:menu" menu_school="curr" />
<include file="Public:navibar" />
<include file="_sub_menu" schoolindex="selected" />
<div id="main">
    <switch name="select">
    <case value="schoolAdd">
        <h4>添加学校</h4>
        <hr class="dash"/>
        <form action="__URL__/schoolAdds" method="post">
            <table class="edit">
                <tr>
                    <td class="label">名称</td>
                    <td><input class="text" type="text" name="school_name" value="{{$school.school_name}}" /></td>
                </tr>
                <tr>
                    <td class="label">简称</td>
                    <td><input class="text" type="text" name="school_abbr" value="{{$school.school_abbr}}" placeholder="拼音缩写" /></td>
                </tr>
                <tr>
                    <td class="label">状态</td>
                    <td><label><input type="checkbox" name="status" value="0" /> 屏蔽</label></td>
                </tr>
                <tr>
                    <td class="label"></td>
                    <td><button class="btn btn_silver fbold" type="submit"><span>保存</span></button></td>
                </tr>
            </table>
        </form>
    </case>

    <case value="schoolEdit">
        <h4>编辑学校</h4>
        <hr class="dash"/>
        <form action="__URL__/schoolEdits" method="post">
            <table class="edit">
                <tr>
                    <td class="label">名称</td>
                    <td><input class="text" type="text" name="school_name" value="{{$school.school_name}}" /></td>
                </tr>
                <tr>
                    <td class="label">简称</td>
                    <td><input class="text" type="text" name="school_abbr" value="{{$school.school_abbr}}" size="10" /></td>
                </tr>
                <tr>
                    <td class="label">状态</td>
                    <td><label><input class="text" type="checkbox" name="status" value="0" <eq name="school.status" value="0">checked</eq> /> 屏蔽</label></td>
                </tr>
                <tr>
                    <td class="label"></td>
                    <td><input type="hidden" name="school_id" value="{{$school.school_id}}" />
                        <button class="btn btn_silver fbold" type="submit"><span>提交</span></button></td>
                </tr>
            </table>
        </form>
    </case>
    <default />
    <h4>学校管理</h4>
    <hr class="dash" />
    <div class="console">
        <form name="search" method="get" action="__URL__/schoolIndex" class="right">
            <select class="select" name="type">
                <option value="school_abbr">简称</option>
                <option value="status">状态(0:正常/1:屏蔽)</option>
            </select>
            <input class="text" type="text" name="keyword" value="{{$keyword}}"  />
            <button class="btn btn_silver fbold" type="submit"><span>搜索</span></button>
        </form>
        <a href="__URL__/schoolAdd" class="btn btn_silver btn_small fbold" ><span>添加学校</span></a>
    </div>
    <table class="list" width="100%">
        <thead>
            <tr>
                <th width="15%">名称</th>
                <th width="8%">简称</th>
                <th width="10%">状态</th>
                <th>下属可用地点</th>
                <th width="15%">操作</th>
            </tr>
        </thead>
        <volist name="school" id="school">
            <tr>
                <td>{{$school.school_name}}</td>
                <td>{{$school.school_abbr}}</td>
                <td><if condition="$school.status eq '1'">正常<else />屏蔽</if></td>
                <td>
                <volist name="school['location']" id="location">
                    <if condition="$location.status eq '1'">{{$location['location_name']}},<else /></if>
                </volist>
                </td>
                <td>
                    <a href="__URL__/schoolEdit/school_id/{{$school.school_id}}">编辑</a>&nbsp;
                    <a href="__URL__/schoolDelete/school_id/{{$school.school_id}}" onclick="return confirm('是否确认提交？')">删除</a>&nbsp;
                </td>
            </tr>    
        </volist>
    </table>
    </switch>
</div>
<include file="Public:footer" />